<template>
  <el-form-item :class="getClz(['text-area'])" :label="opt.text" :prop="opt.name" v-if="!opt.hide" >
    <div>{{text()}}</div>
  </el-form-item>
</template>

<script>
  import extend from '../extend';

  export default {
    name: "FormText",
    mixins:[extend],
    dicts:[],
    data(){
      return {
        opt:{
          name:'',
          text:'',
          prop:'',
          icon:'',
          props:{
            type:'text',
            disabled:false
          },
          options:[],
          hide:false,
          placeholder:''
        }
      }
    },
    mounted(){
      this.initOptions();
      this.onClick = this.opt.onClick || this.onClick;
    },
    methods:{
      text(){
        let opt = this.opt;
        let value = this.data[this.opt.name];
        return _.MONEY(value*100,2,"$ ");
      },
      setValue(val){
        this.data[this.opt.name] = val;
        this.$forceUpdate();
      },
      onClick(){

      }
    }
  }
</script>
